/*
File:		UpgradeState.cpp
Author:		Ben Feldmann
Purpose:	state for managing the upgrade/crafting menu
*/

#include "UpgradeState.h"
#include "Player.h"
#include "Game.h"
#include "GamePlayState.h"

#include "SGD Wrappers/CSGD_DirectInput.h"
#include "SGD Wrappers/CSGD_TextureManager.h"
#include "SGD Wrappers/CSGD_XAudio2.h"

// Weapons
#include "BaseMelee.h"
#include "LaserSword.h"
#include "Saw.h"
#include "Claw.h"
#include "BaseGun.h"
#include "RocketGun.h"
#include "EMPGun.h"
#include "FlamethrowerGun.h"


UpgradeState* UpgradeState::GetInstance()
{
	static UpgradeState instance;
	return &instance;
}

UpgradeState::UpgradeState(void)
{
	curPos = 1;

	backgroundID = -1;
	hudIcons     = -1;
	textBox      = -1;
	surroundBox  = -1;
	curEquipped	 = -1;
	buttonA		 = -1;
	buttonY		 = -1;
	buttonB		 = -1;
	leftBump	 = -1;
	rightBump	 = -1;

	exit = false;

	fistEquip	= false;
	swordEquip	= false;
	sawEquip	= false;
	clawEquip	= false;
	gunEquip	= false;
	rocketEquip	= false;
	empEquip	= false;
	flameEquip	= false;
	camoEquip	= false;
	clockEquip	= false;
	shieldEquip	= false;
	attrEquip   = false;

	weaponOneType = -1;
	weaponTwoType = -1;
	skillOneType  = -1;
	skillTwoType  = -1;
	prevSkillOne  = -1;
	prevSkillTwo  = -1;

	// Prices
	attrMetal		= 100;
	attrCircuit		= 100;

	camoMetal		= 25;
	clockMetal		= 50;
	shieldMetal		= 75;

	camoCircuit		= 75;
	clockCircuit	= 50; 
	shieldCircuit	= 25;

	firstTime = true;

	for(int i = 0; i < 10; i++)
	{
		purchased[i] = 0;
	}


	//InitItems();
}

UpgradeState::~UpgradeState(void)
{
}

void UpgradeState::Enter()
{
	backgroundID	= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/empty_menu.png"));
	hudIcons		= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/request_1_icons.png"));
	textBox			= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/text_box.png"));
	surroundBox		= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/surround_box.png"));
	curEquipped		= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/star.png"));
	buttonA			= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/ButtonA.png"));
	buttonY			= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/ButtonY.png"));
	buttonB			= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/ButtonB.png"));
	leftBump		= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/LeftShoulder.png"));
	rightBump		= CSGD_TextureManager::GetInstance()->LoadTexture(_T("Graphics/Menu Images/RightShoulder.png"));

	// Reset all Weapons & Skills
	fistEquip	= false;
	swordEquip	= false;
	sawEquip	= false;
	clawEquip	= false;
	gunEquip	= false;
	rocketEquip	= false;
	empEquip	= false;
	flameEquip	= false;
	camoEquip	= false;
	clockEquip	= false;
	shieldEquip	= false;
	attrEquip   = false;

	weaponOneType = -1;
	weaponTwoType = -1;
	skillOneType  = -1;
	skillTwoType  = -1;
	prevSkillOne  = -1;
	prevSkillTwo  = -1;

	//CSGD_XAudio2::GetInstance()->SilenceAll();
	if(CSGD_XAudio2::GetInstance()->SFXIsSoundPlaying(player->GetWalkSound()))
		CSGD_XAudio2::GetInstance()->SFXStopSound(player->GetWalkSound());

	curPos = 1;

	exit = false;

	entering = true;

	switch(player->GetMeleeWeaponType())
	{
	case MW_BASE:
		{
			fistEquip = true;
			weaponOneType = MW_BASE;
		}
		break;

	case MW_SWORD:
		{
			swordEquip = true;
			weaponOneType = MW_SWORD;
		}
		break;

	case MW_SAW:
		{
			sawEquip = true;
			weaponOneType = MW_SAW;
		}
		break;

	case MW_CLAW:
		{
			clawEquip = true;
			weaponOneType = MW_CLAW;
		}
		break;
	}
	switch(player->GetRangedWeaponType())
	{
	case RW_BASE:
		{
			gunEquip = true;
			weaponTwoType = RW_BASE;
		}
		break;

	case RW_ROCKET:
		{
			rocketEquip = true;
			weaponTwoType = RW_ROCKET;
		}
		break;

	case RW_EMP:
		{
			empEquip = true;
			weaponTwoType = RW_EMP;
		}
		break;

	case RW_FLAME:
		{
			flameEquip = true;
			weaponTwoType = RW_FLAME;
		}
		break;
	}
	switch(player->GetSkillOne())
	{
	case CAMO:
		{
			camoEquip = true;
			prevSkillOne = CAMO;
		}
		break;

	case CLOCK:
		{
			clockEquip = true;
			prevSkillOne = CLOCK;
		}
		break;

	case SHIELD:
		{
			shieldEquip = true;
			prevSkillOne = SHIELD;
		}
		break;
	}

	switch(player->GetSkillTwo())
	{
	case CAMO:
		{
			camoEquip = true;
			prevSkillTwo = CAMO;
		}
		break;

	case CLOCK:
		{
			clockEquip = true;
			prevSkillTwo = CLOCK;
		}
		break;

	case SHIELD:
		{
			shieldEquip = true;
			prevSkillTwo = SHIELD;
		}
		break;
	}

	for(int i = 0; i < 10; i++)
		purchased[i] = player->purchased[i];


}

void UpgradeState::Exit()
{
	if( player )
		player->Release();
	player = nullptr;

	if(backgroundID != -1)
	{
		CSGD_TextureManager::GetInstance()->UnloadTexture(backgroundID);
		backgroundID = -1;
	}
	if(hudIcons != -1)
	{
		CSGD_TextureManager::GetInstance()->UnloadTexture(hudIcons);
		hudIcons = -1;
	}
	if(textBox != -1)
	{
		CSGD_TextureManager::GetInstance()->UnloadTexture(textBox);
		textBox = -1;
	}
	if(surroundBox != -1)
	{
		CSGD_TextureManager::GetInstance()->UnloadTexture(surroundBox);
		surroundBox = -1;
	}
	if(curEquipped != -1)
	{
		CSGD_TextureManager::GetInstance()->UnloadTexture(curEquipped);
		curEquipped = -1;
	}
	if(leftBump != -1)
	{
		CSGD_TextureManager::GetInstance()->UnloadTexture(leftBump);
		leftBump = -1;
	}
	if(rightBump != -1)
	{
		CSGD_TextureManager::GetInstance()->UnloadTexture(rightBump);
		rightBump = -1;
	}

	fistEquip	= false;
	swordEquip	= false;
	sawEquip	= false;
	clawEquip	= false;
	gunEquip	= false;
	rocketEquip	= false;
	empEquip	= false;
	flameEquip	= false;
	camoEquip	= false;
	clockEquip	= false;
	shieldEquip	= false;
	attrEquip   = false;


}

bool UpgradeState::Input()
{
	Game* game = Game::GetInstance();

	if(CSGD_DirectInput::GetInstance()->JoystickButtonPressed(1, playerIndex))
	{
		player->SetEquipment(weaponOneType, weaponTwoType, skillOneType, skillTwoType, purchased);
		entering = true;
		exit = true;

		CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuBack());

		return true;
	}

	// Move curPos around
	if(CSGD_DirectInput::GetInstance()->JoystickGetLStickDirPressed(DIR_UP, playerIndex))
	{
		if(curPos == 1)
			curPos = 10;			
		else if(curPos == 2)
			curPos = 11;
		else if(curPos == 3)
			curPos = 12;
		else
			curPos -= 3;

		CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuMove());

	}
	if(CSGD_DirectInput::GetInstance()->JoystickGetLStickDirPressed(DIR_DOWN, playerIndex))
	{
		if(curPos == 10)
			curPos = 1;			
		else if(curPos == 11)
			curPos = 2;
		else if(curPos == 12)
			curPos = 3;
		else
			curPos += 3;

		CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuMove());
	}
	if(CSGD_DirectInput::GetInstance()->JoystickGetLStickDirPressed(DIR_LEFT, playerIndex))
	{
		if(curPos == 1)
			curPos = 3;			
		else if(curPos == 4)
			curPos = 6;
		else if(curPos == 7)
			curPos = 9;
		else if(curPos == 10)
			curPos = 12;
		else
			curPos -= 1;

		CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuMove());
	}
	if(CSGD_DirectInput::GetInstance()->JoystickGetLStickDirPressed(DIR_RIGHT, playerIndex))
	{
		if(curPos == 3)
			curPos = 1;			
		else if(curPos == 6)
			curPos = 4;
		else if(curPos == 9)
			curPos = 7;
		else if(curPos == 12)
			curPos = 10;
		else
			curPos += 1;

		CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuMove());
	}

	// Check to see if purchased a weapon
	if(CSGD_DirectInput::GetInstance()->JoystickButtonPressed(0, playerIndex))
	{
		switch(curPos)
		{
		case 3:		// camo
			{
				if(player->GetCircuitry() >= camoCircuit && player->GetMetal() >= camoMetal && 
					toBuy[playerIndex][2][0].purchased == false && player->purchased[0] == 0)
				{
					toBuy[playerIndex][2][0].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - camoCircuit);
					player->SetMetal(player->GetMetal() - camoMetal);

					purchased[0] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 4:		// sword
			{
				if(player->GetCircuitry() >= toBuy[playerIndex][0][1].priceCircuit &&
					player->GetMetal() >= toBuy[playerIndex][0][1].priceMetal && toBuy[playerIndex][0][1].purchased == false && player->purchased[1] == 0)
				{
					toBuy[playerIndex][0][1].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - toBuy[playerIndex][0][1].priceCircuit);
					player->SetMetal(player->GetMetal() - toBuy[playerIndex][0][1].priceMetal);

					purchased[1] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 5:		// rocket
			{
				if(player->GetCircuitry() >= toBuy[playerIndex][1][1].priceCircuit &&
					player->GetMetal() >= toBuy[playerIndex][1][1].priceMetal && toBuy[playerIndex][1][1].purchased == false && player->purchased[2] == 0)
				{
					toBuy[playerIndex][1][1].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - toBuy[playerIndex][1][1].priceCircuit);
					player->SetMetal(player->GetMetal() - toBuy[playerIndex][1][1].priceMetal);

					purchased[2] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 6:		// clock
			{
				if(player->GetCircuitry() >= clockCircuit &&
					player->GetMetal() >=  clockMetal && toBuy[playerIndex][2][1].purchased == false && player->purchased[3] == 0)
				{
					toBuy[playerIndex][2][1].purchased = true;

					player->SetCircuitry(player->GetCircuitry() -clockCircuit);
					player->SetMetal(player->GetMetal() -  clockMetal);

					purchased[3] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 7:		// saw
			{
				if(player->GetCircuitry() >= toBuy[playerIndex][0][2].priceCircuit &&
					player->GetMetal() >= toBuy[playerIndex][0][2].priceMetal && toBuy[playerIndex][0][2].purchased == false && player->purchased[4] == 0)
				{
					toBuy[playerIndex][0][2].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - toBuy[playerIndex][0][2].priceCircuit);
					player->SetMetal(player->GetMetal() - toBuy[playerIndex][0][2].priceMetal);

					purchased[4] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 8:		// emp
			{
				if(player->GetCircuitry() >= toBuy[playerIndex][1][2].priceCircuit &&
					player->GetMetal() >= toBuy[playerIndex][1][2].priceMetal && toBuy[playerIndex][1][2].purchased == false && player->purchased[5] == 0)
				{
					toBuy[playerIndex][1][2].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - toBuy[playerIndex][1][2].priceCircuit);
					player->SetMetal(player->GetMetal() - toBuy[playerIndex][1][2].priceMetal);

					purchased[5] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 9:		// shield
			{
				if(player->GetCircuitry() >= shieldCircuit &&
					player->GetMetal() >= shieldMetal && toBuy[playerIndex][2][2].purchased == false && player->purchased[6] == 0)
				{
					toBuy[playerIndex][2][2].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - shieldCircuit);
					player->SetMetal(player->GetMetal() -  shieldMetal);

					purchased[6] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 10:		// claw
			{
				if(player->GetCircuitry() >= toBuy[playerIndex][0][3].priceCircuit &&
					player->GetMetal() >= toBuy[playerIndex][0][3].priceMetal && toBuy[playerIndex][0][3].purchased == false && player->purchased[7] == 0)
				{
					toBuy[playerIndex][0][3].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - toBuy[playerIndex][0][3].priceCircuit);
					player->SetMetal(player->GetMetal() - toBuy[playerIndex][0][3].priceMetal);

					purchased[7] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 11:		// flame
			{
				if(player->GetCircuitry() >= toBuy[playerIndex][1][3].priceCircuit &&
					player->GetMetal() >= toBuy[playerIndex][1][3].priceMetal && toBuy[playerIndex][1][3].purchased == false && player->purchased[8] == 0)
				{
					toBuy[playerIndex][1][3].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - toBuy[playerIndex][1][3].priceCircuit);
					player->SetMetal(player->GetMetal() - toBuy[playerIndex][1][3].priceMetal);

					purchased[8] = 1;

					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;

		case 12:		// attr
			{
				if(player->GetCircuitry() >= attrCircuit &&
					player->GetMetal() >= attrMetal && toBuy[playerIndex][2][3].purchased == false && player->purchased[9] == 0)
				{
					toBuy[playerIndex][2][3].purchased = true;

					player->SetCircuitry(player->GetCircuitry() - attrCircuit);
					player->SetMetal(player->GetMetal() - attrMetal);

					player->SetMaxHealth(player->GetMaxHealth()+100);
					player->SetMaxEnergy(player->GetMaxEnergy()+100);

					player->SetHealth(player->GetMaxHealth());
					player->SetEnergy(player->GetMaxHealth());

					purchased[9] = 1;
					CSGD_XAudio2::GetInstance()->SFXPlaySound(game->GetMenuSelect());					
				}
			}
			break;
		}
	}

	// Check to see if equipped a weapon //

	// Check for weapons
	if(CSGD_DirectInput::GetInstance()->JoystickButtonPressed(3, playerIndex))
	{
		switch(curPos)
		{
		case 1:		// fist
			{			
				if(toBuy[playerIndex][0][0].purchased == true)
				{
					swordEquip	= false;
					sawEquip	= false;
					clawEquip	= false;

					fistEquip = true;
					weaponOneType = MW_BASE;
				}
			}
			break;

		case 2:		// gun
			{
				if(toBuy[playerIndex][1][0].purchased == true)
				{
					rocketEquip	= false;
					empEquip	= false;
					flameEquip	= false;

					gunEquip = true;
					weaponTwoType = RW_BASE;
				}
			}
			break;

		case 4:		// sword
			{			
				if(toBuy[playerIndex][0][1].purchased == true || purchased[1] == 1)
				{
					fistEquip	= false;
					sawEquip	= false;
					clawEquip	= false;

					swordEquip = true;
					weaponOneType = MW_SWORD;
				}
			}
			break;

		case 5:		// rocket
			{
				if(toBuy[playerIndex][1][1].purchased == true || purchased[2] == 1)
				{
					gunEquip	= false;
					empEquip	= false;
					flameEquip	= false;

					rocketEquip = true;
					weaponTwoType = RW_ROCKET;
				}
			}
			break;

		case 7:		// saw
			{
				if(toBuy[playerIndex][0][2].purchased == true || purchased[4] == 1)
				{
					fistEquip	= false;
					swordEquip	= false;
					clawEquip	= false;

					sawEquip = true;
					weaponOneType = MW_SAW;
				}
			}
			break;

		case 8:		// emp
			{
				if(toBuy[playerIndex][1][2].purchased == true || purchased[5] == 1)
				{
					gunEquip	= false;
					rocketEquip	= false;
					flameEquip	= false;

					empEquip = true;
					weaponTwoType = RW_EMP;
				}
			}
			break;

		case 10:	// claw
			{
				if(toBuy[playerIndex][0][3].purchased == true || purchased[7] == 1)
				{
					fistEquip	= false;
					swordEquip	= false;
					sawEquip	= false;

					clawEquip = true;
					weaponOneType = MW_CLAW;
				}
			}
			break;

		case 11:	// flame
			{
				if(toBuy[playerIndex][1][3].purchased == true || purchased[8] == 1)
				{
					gunEquip	= false;
					rocketEquip	= false;
					empEquip	= false;

					flameEquip = true;
					weaponTwoType = RW_FLAME;
				}
			}
			break;
		}
	}
	// Check for skills
	if(CSGD_DirectInput::GetInstance()->JoystickButtonPressed(4, playerIndex) || CSGD_DirectInput::GetInstance()->JoystickButtonPressed(5, playerIndex))
	{
		switch(curPos)
		{
		case 3:		// camo
			{
				if(toBuy[playerIndex][2][0].purchased == true || purchased[0] == 1)
				{
					if(CSGD_DirectInput::GetInstance()->JoystickButtonPressed(4, playerIndex))
					{
						switch(prevSkillOne)
						{
						case CLOCK:
							{
								clockEquip = false;
							}
							break;

						case SHIELD:
							{
								shieldEquip = false;
							}
							break;
						}
						skillOneType = CAMO;
						camoEquip = true;
						prevSkillOne = CAMO;
					}
					else
					{
						switch(prevSkillTwo)
						{
						case CLOCK:
							{
								clockEquip = false;
							}
							break;

						case SHIELD:
							{
								shieldEquip = false;
							}
							break;
						}
						skillTwoType = CAMO;
						camoEquip = true;
						prevSkillTwo = CAMO;
					}
				}
			}
			break;

		case 6:		// clock
			{
				if(toBuy[playerIndex][2][1].purchased == true || purchased[3] == 1)
				{

					if(CSGD_DirectInput::GetInstance()->JoystickButtonPressed(4, playerIndex))
					{
						switch(prevSkillOne)
						{
						case CAMO:
							{
								camoEquip = false;
							}
							break;

						case SHIELD:
							{
								shieldEquip = false;
							}
							break;
						}
						skillOneType = CLOCK;
						clockEquip = true;
						prevSkillOne = CLOCK;
					}
					else
					{
						switch(prevSkillTwo)
						{
						case CAMO:
							{
								camoEquip = false;
							}
							break;

						case SHIELD:
							{
								shieldEquip = false;
							}
							break;
						}
						skillTwoType = CLOCK;
						clockEquip = true;
						prevSkillTwo = CLOCK;
					}
				}
			}
			break;

		case 9:		// shield
			{
				if(toBuy[playerIndex][2][2].purchased == true || purchased[6] == 1)
				{
					if(CSGD_DirectInput::GetInstance()->JoystickButtonPressed(4, playerIndex))
					{
						switch(prevSkillOne)
						{
						case CAMO:
							{
								camoEquip = false;
							}
							break;

						case CLOCK:
							{
								clockEquip = false;
							}
							break;
						}
						skillOneType = SHIELD;
						shieldEquip = true;
						prevSkillOne = SHIELD;
					}
					else
					{
						switch(prevSkillTwo)
						{
						case CAMO:
							{
								camoEquip = false;
							}
							break;

						case CLOCK:
							{
								clockEquip = false;
							}
							break;
						}
						skillTwoType = SHIELD;
						shieldEquip = true;
						prevSkillTwo = SHIELD;
					}
				}
			}
			break;
		}
	}

	return true;
}

void UpgradeState::Update(float elapsed)
{
	if(entering == true)
	{
		for(int i = 0; i < 10; i++)
			purchased[i] = player->purchased[i];

		entering = false;
	}
}

void UpgradeState::Render()
{
	// Background
	CSGD_TextureManager::GetInstance()->Draw(backgroundID,0,0);

	// Description Box
	RECT box = {0,0,190,330};
	CSGD_TextureManager::GetInstance()->Draw(textBox,540,70,1.0f,1.0f,&box);

	// Show controls for this screen

	if(Game::GetInstance()->GetLanguage() == true)
	{
		// Melee weapons
		char meleeText[20] = "Melee\nWeapons:";
		Game::GetInstance()->DrawBitmapFont(meleeText,80,70,.5f,D3DCOLOR_XRGB(255,255,255));

		// Ranged weapons
		char rengedText[20] = "Ranged\nWeapons:";
		Game::GetInstance()->DrawBitmapFont(rengedText,220,70,.5f,D3DCOLOR_XRGB(255,255,255));

		// Skills
		char skillsText[30] = "Skills &\nAttributes:";
		Game::GetInstance()->DrawBitmapFont(skillsText,360,70,.5f,D3DCOLOR_XRGB(255,255,255));
		// Button A //	460,360
		CSGD_TextureManager::GetInstance()->Draw(buttonA,80,500,.6f,.6f);
		char Abutton[25] = " - Purchase";
		Game::GetInstance()->DrawBitmapFont(Abutton,120,515,.5f,D3DCOLOR_XRGB(255,255,255));
		// Button Y //
		CSGD_TextureManager::GetInstance()->Draw(buttonY,80,440,.6f,.6f);
		char Ybutton[25] = " - Equip Weapon";
		Game::GetInstance()->DrawBitmapFont(Ybutton,120,455,.5f,D3DCOLOR_XRGB(255,255,255));
		// Button B //
		CSGD_TextureManager::GetInstance()->Draw(buttonB,110,470,.6f,.6f);
		char Bbutton[25] = " - Exit";
		Game::GetInstance()->DrawBitmapFont(Bbutton,150,485,.5f,D3DCOLOR_XRGB(255,255,255));

		// Left Bump //
		CSGD_TextureManager::GetInstance()->Draw(leftBump,295,460,.5f,.5f);
		char Lbump[25] = "Assign\nSkills";
		Game::GetInstance()->DrawBitmapFont(Lbump,330,500,.5f,D3DCOLOR_XRGB(255,255,255));
		// Right Bump //
		CSGD_TextureManager::GetInstance()->Draw(rightBump,365,460,.5f,.5f);
		//char Rbump[25] = " - Assign Skill Two";
		//Game::GetInstance()->DrawBitmapFont(Rbump,300,500,.5f,D3DCOLOR_XRGB(255,255,255));

		// Draw the amount of circuitry
		char circuitry[30] = "";
		sprintf_s(circuitry,"Circuitry: %i",player->GetCircuitry());
		circuitry[20] = '\0';
		Game::GetInstance()->DrawBitmapFont(circuitry,450,450,.75f,D3DCOLOR_XRGB(255,255,255));

		// Draw the amount of scrap metal
		char scrap[30] = "";
		sprintf_s(scrap,"Scrap Metal: %i",player->GetMetal());
		scrap[20] = '\0';
		Game::GetInstance()->DrawBitmapFont(scrap,450,480,.75f,D3DCOLOR_XRGB(255,255,255));

		// Show what the star means (currently equipped)
		CSGD_TextureManager::GetInstance()->Draw(curEquipped,450,520,.5f,.5f);
		char star[25] = " - Currently Equipped";
		Game::GetInstance()->DrawBitmapFont(star,470,525,.5f,D3DCOLOR_XRGB(255,255,255));

	}
	else
	{
		// Melee weapons
		Game::GetInstance()->DrawBitmapFontTCHAR(meleeStr,80,70,.5f,D3DCOLOR_XRGB(255,255,255));
		// Ranged weapons
		Game::GetInstance()->DrawBitmapFontTCHAR(rangedStr,220,70,.5f,D3DCOLOR_XRGB(255,255,255));
		// Skills
		Game::GetInstance()->DrawBitmapFontTCHAR(skillsStr,360,70,.5f,D3DCOLOR_XRGB(255,255,255));

		// Button A //	460,360
		CSGD_TextureManager::GetInstance()->Draw(buttonA,80,500,.6f,.6f);	
		Game::GetInstance()->DrawBitmapFontTCHAR(purchaseStr,120,515,.5f,D3DCOLOR_XRGB(255,255,255));
		// Button Y //
		CSGD_TextureManager::GetInstance()->Draw(buttonY,80,440,.6f,.6f);
		Game::GetInstance()->DrawBitmapFontTCHAR(equipStr,120,455,.5f,D3DCOLOR_XRGB(255,255,255));
		// Button B //
		CSGD_TextureManager::GetInstance()->Draw(buttonB,110,470,.6f,.6f);
		Game::GetInstance()->DrawBitmapFontTCHAR(exitStr,150,485,.5f,D3DCOLOR_XRGB(255,255,255));


		// Left Bump //
		CSGD_TextureManager::GetInstance()->Draw(leftBump,285,480,.5f,.5f);
		Game::GetInstance()->DrawBitmapFontTCHAR(assignStr,300,520,.5f,D3DCOLOR_XRGB(255,255,255));
		// Right Bump //
		CSGD_TextureManager::GetInstance()->Draw(rightBump,355,480,.5f,.5f);


		// Draw the amount of circuitry
		_stprintf_s(circuitStr, 20, _T("Circuit: %i"), player->GetCircuitry());
		Game::GetInstance()->DrawBitmapFontTCHAR(circuitStr,450,450,.75f,D3DCOLOR_XRGB(255,255,255));

		// Draw the amount of scrap metal
		_stprintf_s(metalStr,20, _T("Schroot: %i"), player->GetMetal());
		Game::GetInstance()->DrawBitmapFontTCHAR(metalStr,450,480,.75f,D3DCOLOR_XRGB(255,255,255));

		// Show what the star means (currently equipped)
		CSGD_TextureManager::GetInstance()->Draw(curEquipped,450,520,.5f,.5f);
		Game::GetInstance()->DrawBitmapFontTCHAR(curEqStr,470,525,.5f,D3DCOLOR_XRGB(255,255,255));
	}


	//////////////////////
	/* Weapons & Skills */

	// Melee Weapons //

	// Fist
	if(toBuy[playerIndex][0][0].purchased == true)
	{
		RECT fist = {8,144,104,208};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,80,120,1.0f,1.0f,&fist);

		if(fistEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,85,125,.5f,.5f);
	}
	// Sword
	if(toBuy[playerIndex][0][1].purchased == true || player->purchased[1] == 1)
	{
		RECT sword = {8,212,104,276};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,80,200,1.0f,1.0f,&sword);

		if(swordEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,85,205,.5f,.5f);

	}
	else if(toBuy[playerIndex][0][1].purchased == false)
	{
		RECT sword = {208,212,304,276};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,80,200,1.0f,1.0f,&sword);
	}
	// Saw
	if(toBuy[playerIndex][0][2].purchased == true || player->purchased[4] == 1)
	{
		RECT saw = {108,212,204,276};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,80,280,1.0f,1.0f,&saw);

		if(sawEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,85,285,.5f,.5f);
	}
	else if(toBuy[playerIndex][0][2].purchased == false)
	{
		RECT saw = {308,212,404,276};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,80,280,1.0f,1.0f,&saw);
	}
	// Claw
	if(toBuy[playerIndex][0][3].purchased == true || player->purchased[7] == 1)
	{
		RECT claw = {108,144,204,208};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,80,360,1.0f,1.0f,&claw);

		if(clawEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,85,365,.5f,.5f);
	}
	else if(toBuy[playerIndex][0][3].purchased == false)
	{
		RECT claw = {308,144,404,208};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,80,360,1.0f,1.0f,&claw);
	}

	// Ranged Weapons //

	// Gun
	if(toBuy[playerIndex][1][0].purchased == true)
	{
		RECT gun = {8,280,104,344};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,220,120,1.0f,1.0f,&gun);

		if(gunEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,225,125,.5f,.5f);
	}
	// Rocket
	if(toBuy[playerIndex][1][1].purchased == true || player->purchased[2] == 1)
	{
		RECT rocket = {108,348,204,412};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,220,200,1.0f,1.0f,&rocket);

		if(rocketEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,225,205,.5f,.5f);
	}
	else if(toBuy[playerIndex][1][1].purchased == false)
	{
		RECT rocket = {308,348,404,412};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,220,200,1.0f,1.0f,&rocket);
	}
	// Emp
	if(toBuy[playerIndex][1][2].purchased == true || player->purchased[5] == 1)
	{
		RECT emp = {8,348,104,412};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,220,280,1.0f,1.0f,&emp);

		if(empEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,225,285,.5f,.5f);
	}
	else if(toBuy[playerIndex][1][2].purchased == false)
	{
		RECT emp = {208,348,304,412};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,220,280,1.0f,1.0f,&emp);
	}
	// Flame
	if(toBuy[playerIndex][1][3].purchased == true || player->purchased[8] == 1)
	{
		RECT flame = {108,280,204,344};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,220,360,1.0f,1.0f,&flame);

		if(flameEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,225,365,.5f,.5f);
	}
	else if(toBuy[playerIndex][1][3].purchased == false)
	{
		RECT flame = {308,280,404,344};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,220,360,1.0f,1.0f,&flame);
	}

	// Skills //

	// Camo
	if(toBuy[playerIndex][2][0].purchased == true || player->purchased[0] == 1)
	{
		RECT camo = {8,416,72,480};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,120,1.0f,1.0f,&camo);

		if(camoEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,381,125,.5f,.5f);
	}
	else if(toBuy[playerIndex][2][0].purchased == false)
	{
		RECT camo = {212,416,276,480};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,120,1.0f,1.0f,&camo);
	}
	// Clock
	if(toBuy[playerIndex][2][1].purchased == true || player->purchased[3] == 1)
	{
		RECT clock = {76,416,140,480};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,200,1.0f,1.0f,&clock);

		if(clockEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,381,205,.5f,.5f);
	}
	else if(toBuy[playerIndex][2][1].purchased == false)
	{
		RECT clock = {280,416,344,480};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,200,1.0f,1.0f,&clock);
	}
	// Shield
	if(toBuy[playerIndex][2][2].purchased == true || player->purchased[6] == 1)
	{
		RECT shield = {144,416,208,480};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,280,1.0f,1.0f,&shield);

		if(shieldEquip == true)
			CSGD_TextureManager::GetInstance()->Draw(curEquipped,381,285,.5f,.5f);
	}
	else if(toBuy[playerIndex][2][2].purchased == false)
	{
		RECT shield = {348,416,412,480};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,280,1.0f,1.0f,&shield);
	}
	// Attributes
	if(toBuy[playerIndex][2][3].purchased == true || player->purchased[9] == 1)
	{
		RECT attribute = {80,8,144,72};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,360,1.0f,1.0f,&attribute);
	}
	else if(toBuy[playerIndex][2][3].purchased == false)
	{
		RECT attribute = {152,8,216,72};
		CSGD_TextureManager::GetInstance()->Draw(hudIcons,376,360,1.0f,1.0f,&attribute);
	}





	// Text box info & current position box
	if(Game::GetInstance()->GetLanguage() == true)	/* English */
	{
		switch(curPos)
		{
			case 1:
			{			
				Game::GetInstance()->DrawBitmapFontTCHAR(enFistStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][0].x,toBuy[playerIndex][0][0].y,1.0f,1.0f,&surround);
			}
			break;

			case 2:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enGunStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][0].x,toBuy[playerIndex][1][0].y,1.0f,1.0f,&surround);
			}
			break;

			case 3:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enCamoStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][0].x,toBuy[playerIndex][2][0].y,1.0f,1.0f,&surround);
			}
			break;

			case 4:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enSwordStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][1].x,toBuy[playerIndex][0][1].y,1.0f,1.0f,&surround);
			}
			break;

			case 5:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enRockStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][1].x,toBuy[playerIndex][1][1].y,1.0f,1.0f,&surround);
			}
			break;

			case 6:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enClockStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][1].x,toBuy[playerIndex][2][1].y,1.0f,1.0f,&surround);
			}
			break;

			case 7:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enSawStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][2].x,toBuy[playerIndex][0][2].y,1.0f,1.0f,&surround);
			}
				break;

			case 8:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enEMPStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][2].x,toBuy[playerIndex][1][2].y,1.0f,1.0f,&surround);
			}
			break;

			case 9:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enShieldStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][2].x,toBuy[playerIndex][2][2].y,1.0f,1.0f,&surround);
			}
			break;

			case 10:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enClawStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][3].x,toBuy[playerIndex][0][3].y,1.0f,1.0f,&surround);
			}
			break;

			case 11:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enFlameStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][3].x,toBuy[playerIndex][1][3].y,1.0f,1.0f,&surround);
			}
			break;

			case 12:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(enAttrStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][3].x,toBuy[playerIndex][2][3].y,1.0f,1.0f,&surround);
			}
			break;
		}
	}
	else	/* Dutch */
	{
		switch(curPos)
		{
			case 1:
			{	
				Game::GetInstance()->DrawBitmapFontTCHAR(nlFistStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][0].x,toBuy[playerIndex][0][0].y,1.0f,1.0f,&surround);
			}
			break;

			case 2:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlGunStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][0].x,toBuy[playerIndex][1][0].y,1.0f,1.0f,&surround);
			}
			break;

			case 3:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlCamoStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][0].x,toBuy[playerIndex][2][0].y,1.0f,1.0f,&surround);
			}
			break;

			case 4:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlSwordStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][1].x,toBuy[playerIndex][0][1].y,1.0f,1.0f,&surround);
			}
			break;

			case 5:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlRockStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][1].x,toBuy[playerIndex][1][1].y,1.0f,1.0f,&surround);
			}
			break;

			case 6:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlClockStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][1].x,toBuy[playerIndex][2][1].y,1.0f,1.0f,&surround);
			}
			break;

			case 7:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlSawStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][2].x,toBuy[playerIndex][0][2].y,1.0f,1.0f,&surround);
			}
				break;

			case 8:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlEMPStr,555,85,.4f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][2].x,toBuy[playerIndex][1][2].y,1.0f,1.0f,&surround);
			}
			break;

			case 9:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlShieldStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][2].x,toBuy[playerIndex][2][2].y,1.0f,1.0f,&surround);
			}
			break;

			case 10:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlClawStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][0][3].x,toBuy[playerIndex][0][3].y,1.0f,1.0f,&surround);
			}
			break;

			case 11:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlFlameStr,555,85,.4f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][1][3].x,toBuy[playerIndex][1][3].y,1.0f,1.0f,&surround);
			}
			break;

			case 12:
			{
				Game::GetInstance()->DrawBitmapFontTCHAR(nlAttrStr,555,85,.45f,D3DCOLOR_XRGB(255,255,255));		
				RECT surround = {0,0,110,78};
				CSGD_TextureManager::GetInstance()->Draw(surroundBox,toBuy[playerIndex][2][3].x,toBuy[playerIndex][2][3].y,1.0f,1.0f,&surround);
			}
			break;
		}
	}
}

void UpgradeState::InitItems()
{
	firstTime = false;
	// Indexing - [ROW][COLUMN]


	/////////////////////
	//* Melee Weapons *//
	/////////////////////

	// Fist

	for(int i = 0; i < 2; ++i)
	{
		toBuy[i][0][0].position = 1;
		toBuy[i][0][0].purchased = true;
		{
			BaseMelee w = BaseMelee(player);
			w.AddRef();
			toBuy[i][0][0].melee = &w;
		}
		toBuy[i][0][0].priceCircuit = toBuy[i][0][0].melee->GetCircuitPrice();
		toBuy[i][0][0].priceMetal =  toBuy[i][0][0].melee->GetMetalPrice();
		toBuy[i][0][0].x = 73;
		toBuy[i][0][0].y = 113;

		weaponOneType = MW_BASE;

		// Sword
		toBuy[i][0][1].position = 4;
		toBuy[i][0][1].purchased = false;
		{
			LaserSword w = LaserSword(player);
			w.AddRef();
			toBuy[i][0][1].melee = &w;
		}
		toBuy[i][0][1].priceCircuit = toBuy[i][0][1].melee->GetCircuitPrice();
		toBuy[i][0][1].priceMetal =  toBuy[i][0][1].melee->GetMetalPrice();
		toBuy[i][0][1].x = 73;
		toBuy[i][0][1].y = 193;

		// Saw
		toBuy[i][0][2].position = 7;
		toBuy[i][0][2].purchased = false;
		{
			Saw w = Saw(player);
			w.AddRef();
			toBuy[i][0][2].melee = &w;
		}
		toBuy[i][0][2].priceCircuit = toBuy[i][0][2].melee->GetCircuitPrice();
		toBuy[i][0][2].priceMetal =  toBuy[i][0][2].melee->GetMetalPrice();
		toBuy[i][0][2].x = 73;
		toBuy[i][0][2].y = 273;

		// Claw
		toBuy[i][0][3].position = 10;
		toBuy[i][0][3].purchased = false;
		{
			Claw w = Claw(player);
			w.AddRef();
			toBuy[i][0][3].melee = &w;
		}
		toBuy[i][0][3].priceCircuit = toBuy[i][0][3].melee->GetCircuitPrice();
		toBuy[i][0][3].priceMetal =  toBuy[i][0][3].melee->GetMetalPrice();
		toBuy[i][0][3].x = 73;
		toBuy[i][0][3].y = 353;


		//////////////////////
		//* Ranged Weapons *//
		//////////////////////

		// Gun
		toBuy[i][1][0].position = 2;
		toBuy[i][1][0].purchased = true;
		{
			BaseGun w = BaseGun(player);
			w.AddRef();
			toBuy[i][1][0].ranged = &w;
		}
		toBuy[i][1][0].priceCircuit = toBuy[i][1][0].ranged->GetCircuitPrice();
		toBuy[i][1][0].priceMetal =  toBuy[i][1][0].ranged->GetMetalPrice();
		toBuy[i][1][0].x = 213;
		toBuy[i][1][0].y = 113;

		weaponTwoType = RW_BASE;

		// Rocket
		toBuy[i][1][1].position = 5;
		toBuy[i][1][1].purchased = false;
		{
			RocketGun w = RocketGun(player);
			w.AddRef();
			toBuy[i][1][1].ranged = &w;
		}
		toBuy[i][1][1].priceCircuit = toBuy[i][1][1].ranged->GetCircuitPrice();
		toBuy[i][1][1].priceMetal =  toBuy[i][1][1].ranged->GetMetalPrice();
		toBuy[i][1][1].x = 213;
		toBuy[i][1][1].y = 193;

		// EMP
		toBuy[i][1][2].position = 8;
		toBuy[i][1][2].purchased = false;
		{
			EMPGun w = EMPGun(player);
			w.AddRef();
			toBuy[i][1][2].ranged = &w;
		}
		toBuy[i][1][2].priceCircuit = toBuy[i][1][2].ranged->GetCircuitPrice();
		toBuy[i][1][2].priceMetal =  toBuy[i][1][2].ranged->GetMetalPrice();
		toBuy[i][1][2].x = 213;
		toBuy[i][1][2].y = 273;

		// Flame
		toBuy[i][1][3].position = 11;
		toBuy[i][1][3].purchased = false;
		{
			FlamethrowerGun w = FlamethrowerGun(player);
			w.AddRef();
			toBuy[i][1][3].ranged = &w;
		}
		toBuy[i][1][3].priceCircuit = toBuy[i][1][3].ranged->GetCircuitPrice();
		toBuy[i][1][3].priceMetal =  toBuy[i][1][3].ranged->GetMetalPrice();
		toBuy[i][1][3].x = 213;
		toBuy[i][1][3].y = 353;


		//////////////
		//* Skills *//
		//////////////

		// Camo
		toBuy[i][2][0].position = 3;
		toBuy[i][2][0].purchased = false;
		//toBuy[2][0].melee = nullptr;
		//toBuy[2][0].ranged = nullptr;
		toBuy[i][2][0].skill = CAMO;
		toBuy[i][2][0].x = 353;
		toBuy[i][2][0].y = 113;
		toBuy[i][2][0].priceCircuit = 75;
		toBuy[i][2][0].priceMetal = 25;

		// Clock
		toBuy[i][2][1].position = 6;
		toBuy[i][2][1].purchased = false;
		//toBuy[2][1].melee = nullptr;
		//toBuy[2][1].ranged = nullptr;
		toBuy[i][2][1].skill = CLOCK;
		toBuy[i][2][1].x = 353;
		toBuy[i][2][1].y = 193;

		// Shield
		toBuy[i][2][2].position = 9;
		toBuy[i][2][2].purchased = false;
		//toBuy[2][2].melee = nullptr;
		//toBuy[2][2].ranged = nullptr;
		toBuy[i][2][2].skill = SHIELD;
		toBuy[i][2][2].x = 353;
		toBuy[i][2][2].y = 273;

		// Health/Energy
		toBuy[i][2][3].position = 12;
		toBuy[i][2][3].purchased = false;
		//toBuy[2][3].melee = nullptr;
		//toBuy[2][3].ranged = nullptr;
		//toBuy[2][3].skill = SHIELD;
		toBuy[i][2][3].x = 353;
		toBuy[i][2][3].y = 353;
		toBuy[i][2][3].priceMetal = 100;
		toBuy[i][2][3].priceCircuit = 100;
	}
}
